Switchable propagation neural network

ABSTRACT

A temporal propagation network (TPN) system learns the affinity matrix for video image processing tasks. An affinity matrix is a generic matrix that defines the similarity of two points in space. The TPN system includes a guidance neural network model and a temporal propagation module and is trained for a particular computer vision task to propagate visual properties from a key-frame represented by dense data (color), to another frame that is represented by coarse data (grey-scale). The guidance neural network model generates an affinity matrix referred to as a global transformation matrix from task-specific data for the key-frame and the other frame. The temporal propagation module applies the global transformation matrix to the key-frame property data to produce propagated property data (color) for the other frame. For example, the TPN system may be used to colorize several frames of greyscale video using a single manually colorized key-frame.

CLAIM OF PRIORITY

This application is a divisional of U.S. Non-Provisional applicationSer. No. 16/353,835 titled “Switchable Propagation Neural Network,”filed Mar. 14, 2019, which is a continuation-in-part of U.S.Non-Provisional application Ser. No. 16/134,716 titled “LearningAffinity Via a Spatial Propagation Network,” filed Sep. 18, 2018, whichclaims the benefit of U.S. Provisional Application No. 62/563,538 titled“Learning Affinity Via Spatial Propagation Networks,” filed Sep. 26,2017. The entire contents of these applications are incorporated hereinby reference.

FIELD OF THE INVENTION

The present invention relates to computer vision, and in particular, toa temporal propagation network (TPN) system for learning affinitymatrices for video image processing tasks.

BACKGROUND

An affinity matrix is a generic matrix that measures pairwiserelationships between points, indicating how close, or similar, twopoints are in a space. Affinity matrices are widely used in computervision problems, representing a weighted graph that regards each pixelas a node and connects each pair of pixels by an edge. The weight(affinity value) on an edge should reflect the pairwise similarity withrespect to a task. For example, for low-level vision tasks such as imagefiltering, the affinity values should reveal the low-level coherence ofcolor and texture; for mid to high-level vision tasks such as imagematting and segmentation, the affinity values should reveal thesemantic-level pairwise similarities. Most techniques explicitly orimplicitly assume a measurement or a similarity structure over the spaceof configurations. The success of a technique depends heavily on theassumptions made to construct the affinity matrices, which are generallyconstructed manually. There is a need for addressing these issues and/orother issues associated with the prior art.

SUMMARY

A temporal propagation network (TPN) system learns the affinity matrixfor video image processing tasks. An affinity matrix is a generic matrixthat defines the similarity of two points in space. Examples of visualproperties that may be propagated from a key-frame represented by densedata (color, high-dynamic range, segmentation mask), to another framethat is represented by coarse data (grey-scale, low-dynamic range, nosegmentation). The TPN system is trained for a particular computervision task.

The TPN system includes a guidance neural network model and a temporalpropagation module. The guidance neural network model generates anaffinity matrix referred to as a global transformation matrix (guidancedata) from task-specific data for the key-frame and the other frame.Examples of task-specific data include lightness, LDR, and RGB color,for the tasks of colorization, conversion to HDR, and segmentation,respectively. The temporal propagation module applies the globaltransformation matrix to the key-frame property data to producepropagated property data for the other frame. For example, the propertydata may be color data, high-dynamic range data, or a segmentation mask.Thus, the TPN system may be used to colorize several frames of greyscalevideo using a single manually colorized key-frame.

A method, computer readable medium, and system are disclosed fortraining a switchable propagation network. Ground truth property data isreceived for a key-frame of a video sequence defining values of aproperty of each pixel in the key-frame and ground truth property datais received for an additional frame of the video sequence definingvalues of the property of each pixel in the additional frame.Task-specific affinity values are received for transitions from thekey-frame to the additional frame and a first switchable temporalpropagation module processes the property data for the key-frame and thetask-specific affinity values to produce property data for theadditional frame. A second switchable temporal propagation moduleprocesses ground truth property data for the additional frame and thetask-specific affinity values to produce property data for the key-frameand coefficients of the first switchable temporal propagation module areupdated to reduce differences between the ground truth property data forthe additional frame and the property data for the additional frame.

A method, computer readable medium, and system are disclosed for aswitchable propagation network. Task-specific data is received for akey-frame of a video sequence defining attributes of pixels in thekey-frame and task-specific data is received for a frame of the videosequence defining attributes of pixels in the frame. The task-specificdata for the key-frame and the task-specific data for the frame areprocessed according to parameters, by a guidance neural network model,to produce guidance data for a task. A temporal propagation moduleapplies the guidance data to property data for the key-frame to generateproperty data for the frame.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A illustrates a block diagram of a spatial linear propagationnetwork (SLPN) system, in accordance with an embodiment.

FIG. 1B illustrates a conceptual diagram of 3-way propagation fromleft-to-right, in accordance with an embodiment.

FIG. 1C illustrates a conceptual diagram of 3-way propagation in fourdirections, in accordance with an embodiment.

FIG. 1D illustrates a flowchart of a method for generating a refinedaffinity matrix using the system shown in FIG. 1A, in accordance with anembodiment.

FIG. 1E illustrates a flowchart of a method for training the SLPN systemshown in FIG. 1A, in accordance with an embodiment.

FIG. 2A illustrates a block diagram of a temporal propagation network(TPN) system, in accordance with an embodiment.

FIG. 2B illustrates a flowchart of a method for propagating propertydata using the system shown in FIG. 2A, in accordance with anembodiment.

FIG. 2C illustrates a conceptual diagram of 3-way propagation fromleft-to-right, and right-to-left corresponding to a triangular matrixand a transposed triangular matrix, respectively, in accordance with anembodiment.

FIG. 2D illustrates a conceptual diagram of forward propagation andswitching sets of weight sub-matrices to implement reverse propagation,in accordance with an embodiment.

FIG. 2E illustrates a block diagram of a bi-directional trainingconfiguration for a switchable TPN system, in accordance with anembodiment.

FIG. 2F illustrates a flowchart of a method for training the switchableTPN system shown in FIG. 2E, in accordance with an embodiment.

FIG. 3 illustrates a parallel processing unit, in accordance with anembodiment.

FIG. 4A illustrates a general processing cluster within the parallelprocessing unit of FIG. 3, in accordance with an embodiment.

FIG. 4B illustrates a memory partition unit of the parallel processingunit of FIG. 3, in accordance with an embodiment.

FIG. 5A illustrates the streaming multi-processor of FIG. 4A, inaccordance with an embodiment.

FIG. 5B is a conceptual diagram of a processing system implemented usingthe PPU of FIG. 3, in accordance with an embodiment.

FIG. 5C illustrates an exemplary system in which the variousarchitecture and/or functionality of the various previous embodimentsmay be implemented.

DETAILED DESCRIPTION

An affinity matrix is a spatially varying transformation matrix thatdefines the similarity of two points in space. Examples ofaffinity-related computer vision tasks include image matteing,segmentation, and colorization. A spatial linear propagation network(SLPN) system learns the task-specific affinity matrix for vision tasksin a data driven manner. As described herein, the SLPN system may beimplemented as a row/column linear propagation model for learning theaffinity matrix instead of designing similarity kernels heuristically.The SLPN system is a row/column linear propagation mode and thetask-specific affinity matrix that is learned models dense, globalpairwise relationships of an image.

FIG. 1A illustrates a block diagram of the SLPN system 100, inaccordance with an embodiment. Although the SLPN system 100 is describedin the context of a neural network model, the SLPN system 100 may alsobe performed by a program, custom circuitry, or by a combination ofcustom circuitry and a program. For example, the SLPN system 100 may beimplemented using a GPU (graphics processing unit), CPU (centralprocessing unit), or any processor capable of performing the operationsdescribed herein. Furthermore, persons of ordinary skill in the art willunderstand that any system that performs the operations of the SLPNsystem 100 is within the scope and spirit of embodiments of the presentinvention.

As shown in FIG. 1A, the SLPN system 100 includes a guidance neuralnetwork model 120 and a spatial linear propagation module 110. The SLPNsystem 100 is trained for a particular computer vision task. Duringtraining, parameters of the guidance neural network model 120 andcoefficients used for propagation in the spatial linear propagationmodule 110 are determined. In an embodiment, the guidance neural networkmodel 120 is a deep convolutional neural network (CNN).

Inputs to the SLPN system 100 are input data (e.g., pixel values for animage) and an input map corresponding to the input data to bepropagated. The input map defines pixel properties (e.g., color, object,texture, shape, etc.) for at least a portion of the pixels in the inputdata. For example, as shown in FIG. 1A, the input data is an image of abicycle in front of a background and the input map coarsely identifiespixels that define the bicycle, segmenting pixels representing thebicycle from pixels representing the background. In an embodiment, theinput data and input map are each an array (at least 2 dimensions).

The guidance neural network model 120 processes the input data accordingto the parameters to produce guidance data (task-specific affinityvalues). In an embodiment, the task-specific affinity values are a setof arrays, including an array for each channel of input data (e.g., red,green, blue). Furthermore, in an embodiment, a separate set of arrays isincluded for each propagation direction used by the spatial linearpropagation module 110 to process the input map. For example, thepropagation directions may be left-to-right (columns), right-to-left(columns), top-to-bottom (rows), and bottom-to-top (rows).

Inputs to the spatial linear propagation module 110 are the input mapand the guidance data that are used as weights (or coefficients) forprocessing the input map to produce refined map data. The spatial linearpropagation module 110 propagates information in an image, defined bythe input map, based on the task-specific affinity values generated bythe guidance neural network model 120. As shown in FIG. 1A, the refinedmap data identifies pixels that define the bicycle more accuratelycompared with the input map, thereby enabling more precise segmentationof pixels representing the bicycle from pixels representing thebackground.

The guidance neural network model 120 and the spatial linear propagationmodule 110 are differentiable and may be jointly trained using thestochastic gradient descent (SGD) loss function. In an embodiment, thespatial linear propagation module 110 is implemented as recurrentarchitecture and is therefore computationally efficient for inferencedue to the linear time complexity of the recurrent architecture.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay be implemented, per the desires of the user. It should be stronglynoted that the following information is set forth for illustrativepurposes and should not be construed as limiting in any manner. Any ofthe following features may be optionally incorporated with or withoutthe exclusion of other features described.

The advantages of learning a task-specific affinity matrix in adata-driven manner are multifold. First, a hand-designed similaritymatrix based on a distance metric in a certain space (e.g., RGB orEuclidean) may not adequately describe the pairwise relationships in themid-to-high-level feature spaces. To apply such designed pairwisekernels to tasks such as semantic segmentation, multiple iterations arerequired for satisfactory performance. In contrast, the guidance neuralnetwork model 120 learns and outputs all entities of an affinity matrixunder direct supervision of ultimate objectives, where no iteration,specific design or assumption about the kernel function is needed.Second, in an embodiment, high-level semantic affinity measures may belearned by initializing the guidance neural network model 120 withhierarchical deep features from a pre-trained neural network whereconventional metrics and kernels may not be applied.

By constructing a row/column-oriented linear propagation model, aspatially varying transformation matrix exactly constitutes atask-specific affinity matrix that models dense, global pairwiserelationships of pixels in an image. In an embodiment, a three-wayrow/column connection is used for the spatial linear propagation module110, which (a) formulates a sparse transformation matrix, where allelements can be outputs from a deep CNN, but (b) results in a denseaffinity matrix that effectively models any task-specific pairwisesimilarity matrix. Instead of designing the similarity kernels accordingto image features of two points, all of the similarities can be directlyoutput by the guidance neural network model 120 in a purely data-drivenmanner. The spatial linear propagation network system 100 provides ageneric framework that can be applied to many affinity-related tasks,such as image matteing, segmentation, colorization, and the like.Essentially, the guidance neural network model 120 can learnsemantically-aware affinity values for high-level vision tasks due tothe powerful learning capability of deep CNNs. The spatial linearpropagation network system 100 provides a general, effective andefficient solution for generating high-quality segmentation results.

The problem of learning the task-specific affinity matrix can beequivalently expressed as learning a group of small row/column-wise,spatially varying linear transformation matrices. Since a lineartransformation can be implemented as a differentiable module in a deepneural network, the transformation matrix can be learned in a purelydata-driven manner as opposed to being constructed by hand.Specifically, RGB images may be used as input data and the task-specificaffinity values are learned by the guidance neural network model 120conditioned on the specific input data. A three-way connection may beused, instead of full connections between adjoining rows/columns. Thethree-way connection is sufficient for learning a dense affinity matrixand requires many fewer output channels of a deep CNN.

FIG. 1B illustrates a conceptual diagram of 3-way propagation fromleft-to-right, in accordance with an embodiment. The task-specificaffinity values computed by the guidance neural network model 120 areapplied to values in the input map, where each pixel of the input map isrepresented as a circle and each task-specific affinity value (weight)is represented as an arrow. At least two weighted values from eachcolumn of the task-specific affinity matrix contributing to a value inthe refined map data for the adjacent column. As shown in FIG. 1A, threeweighted values from a first column 130 contribute to each of the threevalues in a second column 131 in a left-to-right propagation direction.The three values in the second column 131 contribute to the value in athird column 132. The 3-way propagation is repeated to produce eachpixel value of the refined map data.

When a one-way connection is used the value 136 in the first column 130,the value 133 in the second column 131, and the value 134 in the thirdcolumn 132 contribute to a pixel value of the refined map data. Theone-way connection enables every pixel of the input map to connect toonly one pixel from the previous column. The one-way connection isequivalent to one-dimensional (1D) linear recurrent propagation thatscans each column independently as a 1D sequence. The left-to-rightpropagation for a one-way connection is:h _(k,t)=(1−p _(k,t))·x _(k,t) +p _(k,t) ·h _(k,t-1),  (1)where x_(k,t) and h_(k,t) are the k^(th) pixels in the t^(th) column andp is a scaler weight indicating the propagation strength between thepixels at {k, t−1} and {k, t}. The one-way connection is a directextension of sequential recurrent propagation, and, for semanticsegmentation, p corresponds to the object edges.

As shown in FIG. 1B, a three-way connection enables each pixel toconnect to three pixels from the previous row/column, i.e., theleft-top, middle and bottom pixels from the previous column for theleft-to-right propagation direction.

denotes the set of the three pixels and the left-to-right propagationfor a three-way connection is:h _(k,t)=(1−

p _(k,t))x _(k,t) +

p _(k,t) h _(k,t-1),  (2)where x_(k,t) and h_(k,t) are the k^(th) pixels in the t^(th) column andp is a scaler weight indicating the propagation strength between thepixels at {k, t−1} and {k, t}.

In an embodiment, two-way propagation is used, where two of the threevalues in the column 130 are weighted and propagated by the spatiallinear propagation module 110 to two of the values in column 131. Forexample, the values 135, 136, 137, 138, 139, and 134 contribute to apixel value in the refined map data. The two-way propagation isperformed by the spatial linear propagation module 110 for each pixel inthe refined map data. When two-way propagation is performed usingequation (2),

denotes the set of the two pixels and the left-to-right propagation fora two-way connection.

The propagation may be performed in more than one direction to generateeach pixel value in the refined map data. FIG. 1C illustrates aconceptual diagram of three-way propagation in four directions, inaccordance with an embodiment. The entire input map may be scannedrow/column-wise in four fixed directions: left-to-right, top-to-bottom,and vise-versa Equation (2) may be computed by the spatial linearpropagation module 110 to compute a contribution from each of the fourdirections and the contributions may be combined to produce a value foreach pixel of the refined map data. Integration of the four directionsformulates global and densely connected pairwise relations between thepixels. In an embodiment, the propagation computation is performedrecursively by column or row of the input data and each propagationdirection may be traversed in parallel by the spatial linear propagationmodule 110 and combined to generate the refined map data.

In contrast with the three-way propagation technique, a conventionaltechnique for applying a linear transformation to the input map requiresmore propagation computations for each pixel of the input map becauseeach pixel in a first row/column is propagated to each and every pixelin a subsequent row/column. As an example, the left-to-right directionis described as an example for the following discussion. Otherdirections are processed independently in the same manner. X and Hdenote two 2D maps of size n×n, with exactly the same dimensions as thematrix before and after spatial propagation, where x_(t) and h_(t),respectively, represent their t^(th) columns with n×1 elements each.Information is linearly propagated from left-to-right between adjacentcolumns using an n×n linear transformation matrix w_(t) as:h _(t)=(I−d _(t))x _(t) +w _(t) h _(t-1) , t∈[2,n]  (3)where I is the n×n identity matrix, the initial condition h₁=x₁, andd_(t)(i, i) is a diagonal matrix, whose i^(th) element is the sum of allthe elements of the i^(th) row of w_(t) except w_(t)(i,j) as:d _(t)(i,i)=Σ_(j=1,j≠1) ^(n) w _(t)(i,j).  (4)

To propagate across the entire image, the matrix H, where {h_(t)∈H,t∈[1, n]}, is updated in a column-wise manner recursively. For eachcolumn. h_(t) is a linear, weighted combination of the previous columnh_(t-1), and the corresponding column x_(t) in X. When the recursivescanning is finished, the updated 2D matrix H can be expressed with anexpanded formulation of Equation (3):

$\begin{matrix}{{{\begin{bmatrix}I & 0 & \cdots & \cdots & 0 \\w_{2} & \lambda_{2} & 0 & \cdots & \cdots \\{w_{3}w_{2}} & {w_{3}\lambda_{2}} & \lambda_{3} & 0 & \cdots \\\vdots & \vdots & \vdots & \cdots & \vdots \\\vdots & \vdots & \vdots & \cdots & \lambda_{n}\end{bmatrix}X_{v}} = {GX}_{v}},} & (5)\end{matrix}$where G is a lower triangular, N×N(N=n²) transformation matrix, whichrelates X and H. H_(v) and X_(v) are vectorized versions of X and H,respectively, with the dimension of N×1. Specifically, H_(v) and X_(v)are created by concatenating h_(t) and x_(t) along the same, singledimension, i.e., H_(v)[h₁ ^(T), . . . , h_(n) ^(T)]^(T) and X_(v)[x₁^(T), . . . , x_(n) ^(T)]^(T). All the parameters {λ_(t), w_(t), d_(t),I}, t∈[2, n] are n×n sub-matrices, where λ_(t)=I−d_(t).

In contrast with conventional techniques, an affinity matrix A computedby the guidance neural network model 120 is the off-diagonal part of thematrix G.

$\begin{matrix}{A = \begin{bmatrix}0 & 0 & \cdots & \cdots & 0 \\w_{2} & 0 & 0 & \cdots & \cdots \\{w_{3}w_{2}} & {w_{3}\lambda_{2}} & 0 & 0 & \cdots \\\vdots & \vdots & \vdots & \cdots & \vdots \\\vdots & \vdots & \vdots & \cdots & 0\end{bmatrix}} & (6)\end{matrix}$Equation (6) represents a spatial anisotropic diffusion process. Aproperty of the row/column-wise linear propagation in Equation (3) is astandard diffusion process where L defines the spatial propagation andA, the affinity matrix, describes the similarities between any twopoints. L=D−A, where L is a Laplacian matrix, D is the degree matrixcomposed of d_(t) in Equation (4), and A is the affinity matrix.Learning the affinity matrix A is equivalent to learning a group oftransformation matrices w_(t) in Equation (3).

However, the affinity matrix shown in Equation (6), uses afully-connected spatial propagation in four separate directions,presenting an enormous computational load for a neural network.Therefore, the number of connections is reduced, so that instead ofbeing fully-connected, the connections for each pixel are reduced to atleast two. As an example, when the input data has c channels, the outputneeds n×c×4 channels (there are n connections from the previousrow/column per pixel per channel, and with four different directions).Obviously, the output is too large (e.g., a 128×128×16 feature map needsan output of 128×128×8192) to be implemented in a real-world system.Instead of using full connections between the adjacent rows/columns,certain local connections, corresponding to a sparse row/column-wisetransform matrix, can also formulate densely connected affinity for atask.

In an embodiment, as shown in FIG. 1B, each pixel is connected to threenearest pixels in the previous row or column. In contrast with theconventional technique, when the three-way propagation technique isused, the task-specific affinity matrix w_(t) forms a tridiagonalmatrix, constituted by all w_(t) for t∈[2, n], with the three non-zeroelements in each column constituted by p_(k,t) k∈

from Equations (1) and (2). In an embodiment, task-specific affinitymatrices are generated for each propagation direction and for eachchannel of the input data.

When one-way connections are used, the affinity matrix A is sparse sinceeach sub-matrix of A has nonzero elements only along the diagonal, andthe multiplication of several individual diagonal matrices will alsoresult in a diagonal matrix. On the other hand, the three-wayconnection, also with a sparse w_(t), can form a relatively denseaffinity matrix A with the multiplication of several differenttridiagonal matrices. Therefore, pixels can be densely and globallyassociated, by simply increasing the number of connections of each pixelduring spatial propagation from one to three. The propagation of one-wayconnections is restricted to a single row, while the three-wayconnections can expand the region to a triangular 2D plane with respectto each direction, as shown in FIG. 1B. The summarization of the fourdirections result in dense connections of all pixels to each other, asshown in FIG. 1C.

FIG. 1D illustrates a flowchart of a method for generating a refined mapdata, in accordance with an embodiment. Although method 130 is describedin the context of a processing unit, the method 130 may also beperformed by a program, custom circuitry, or by a combination of customcircuitry and a program. For example, the method 130 may be executed bya GPU (graphics processing unit), CPU (central processing unit), or anyprocessor capable of performing the spatial linear propagationoperations. Furthermore, persons of ordinary skill in the art willunderstand that any system that performs method 130 is within the scopeand spirit of embodiments of the present invention.

At step 135, the spatial linear propagation module 110 receives an inputmap defining properties of pixels in an image. At step 140, the spatiallinear propagation module 110 receives task-specific affinity values forthe pixels in the image. In an embodiment, the task-specific affinityvalues are generated by the guidance neural network model 120. The SLPNsystem is trained for a particular computer vision task. Duringtraining, parameters of the guidance neural network model 120 aredetermined for the particular computer vision task. In an embodiment,the guidance neural network model 120 and the spatial linear propagationmodule 110 are jointly trained for the particular computer vision task.After training, the parameters (e.g., coefficients) used by the guidanceneural network model 120 are fixed and the guidance neural network model120 generates task-specific affinity values for each input data,according to the parameters.

At step 145, the spatial linear propagation module 110 processes theinput map and the task-specific affinity values to produce refined mapdata, where at least two task-specific affinity values aligned in afirst pixel dimension are applied to spatially corresponding values inthe input map to generate each refined value of the refined map data.For example, the at least two task-specific affinity values may bealigned in either the horizontal (in the same row) or vertical (in thesame column) direction. As shown in FIG. 1B, the three task-specificaffinity values are applied to spatially corresponding values in column130 of the input map to compute three intermediate values in theadjacent column 131. The three intermediate values are combined tocompute the refined map data in the adjacent column 132.

The spatial linear propagation network system 100 is differentiable, sothat the task-specific affinity matrix w_(t) can be learned in adata-driven manner. In an embodiment, the guidance neural network model120 is a deep CNN that outputs all elements of the task-specificaffinity matrix, w_(t). In an embodiment, the spatial linear propagationmodule 110 receives the input map and outputs a transformed resultcomprising refined map data. The spatial linear propagation module 110also receives w_(t) generated by the guidance neural network model 120based on the input data corresponding to the input map.

Assuming an input map of size n×n×c is input to the spatial linearpropagation module 110, the guidance neural network model 120 shouldoutput a weight map with the dimensions of n×n×c×(3×4), i.e., each pixelin the input map is paired with 3 scalar weights per direction, and 4directions in total. The input data has c channels (e.g., an RGB imagehas c=3). The spatial linear propagation module 110 contains fourindependent hidden layers for the different directions, where each layercombines the input map with its respective weight map using Equation(2). All submodules are differentiable and jointly trained usingstochastic gradient descent (SGD). In an embodiment, node-wisemax-pooling is used to integrate the hidden layers and to obtain thefinal propagation result.

Because the spatial propagation in Equation (3) is differentiable, thetransformation matrix can be easily configured as a row/column-wisefully-connected layer. However, because the task-specific affinitymatrix indicates the pairwise similarities of a specific input, theguidance neural network model 120 should also be conditioned on thecontent of this input (i.e., different input images should havedifferent affinity matrices). Instead of setting the w_(t) matrices asfixed parameters of the spatial linear propagation module 110, thetask-specific affinity matrix values are the outputs of a deep CNN,which can be directly conditioned on an input image.

Model stability is of critical importance for designing linear systems,such as the spatial linear propagation network system 100. In thecontext of spatial propagation according to Equation (3), to ensurestability, the responses or errors that flow in the spatial linearpropagation module 110 may be restricted from going to infinity andpreventing the spatial linear propagation network system 100 fromencountering the vanishing of gradients in the backpropagation process.Specifically, the norm of the temporal Jacobian ∂h_(t)\∂h_(t-1) shouldbe equal to or less than one. Restricting the norm of the temporalJacobian to be equal to or less than one is equivalent to regularizingeach transformation matrix w_(t) with its norm satisfying∥∂h _(t) \∂h _(t-1) ∥=∥w _(t)∥≤λ_(max),where λ_(max) denotes the largest singularity value of w_(t). Thecondition, λ_(max)≤1 provides a sufficient condition for stability.Stability of the spatial linear propagation module 110 can be maintainedby regularizing all weights of a pixel in the hidden layer H, limitingthe summation of the absolute values of the weights for each pixel toless than one. For a three-way connection, the three weights may beregularized.

FIG. 1E illustrates a flowchart of a method for training the SLPN system100 shown in FIG. 1A, in accordance with an embodiment. Although method150 is described in the context of a processing unit, the method 150 mayalso be performed by a program, custom circuitry, or by a combination ofcustom circuitry and a program. For example, the method 150 may beexecuted by a GPU (graphics processing unit), CPU (central processingunit), or any processor capable of performing the spatial linearpropagation operations. Furthermore, persons of ordinary skill in theart will understand that any system that performs method 150 is withinthe scope and spirit of embodiments of the present invention.

At step 155, the spatial linear propagation module 110 receives an inputmap defining properties of pixels in an image. At step 160, the guidanceneural network model 120 receives input data comprising the image.During training, the input map and the input data are included in atraining dataset for a particular computer vision task. Each image inthe input data is paired with a ground truth segmentation mask. In anembodiment, the input map is not included with the training dataset andis instead generated from either the ground truth segmentation mask orthe input data.

At step 165, the guidance neural network model 120 generatestask-specific affinity values for the pixels in the image. At step 170,the spatial linear propagation module 110 processes the input mapaccording to the task-specific affinity values to produce refined mapdata. At step 175, a loss function is computed based on the refined mapdata and a ground truth map. For example, when the computer vision taskis segmentation, the ground truth map is a segmentation mask.

At step 180, a determination is made whether an error between therefined map data and the ground truth map is reduced below a thresholdvalue to achieve a defined accuracy. If so, at step 190 thetask-specific training is completed. Otherwise, at step 185, parametersof the guidance neural network model 120 are updated by back propagatingthe loss function before returning to step 155 to receive another inputmap corresponding to an image from the training dataset. After training,the parameters (e.g., coefficients) used by the guidance neural networkmodel 120 are fixed and the guidance neural network model 120 generatestask-specific affinity values for each input data, according to theparameters.

In sum, spatial linear propagation network system 100 can transform atwo-dimensional (2D) input map (e.g., coarse image segmentation) intorefined map data with desired properties (e.g., refined segmentation).With spatially varying parameters supporting the propagation process,the spatial linear propagation network system 100 can be configured toperform a standard anisotropic diffusion process. The transformation ofthe input maps is controlled by a Laplacian matrix that is constitutedby the task-specific affinity values generated by the guidance neuralnetwork model 120. Since the spatial linear propagation network system100 is differentiable, the parameters can be learned through jointtraining. Importantly, each refined map is generated in a single passthrough the spatial linear propagation network system 100 and the numberof connections is reduced, reducing the computations needed to generateeach refined map.

The spatial linear propagation network system 100 can be trained toperform operations other than object segmentation. In an embodiment, thespatial linear propagation network system 100 is trained to performaffinity-based editing, such as colorization, where the input map iscolor values associated a subset of the pixels within an image and therefined map data is colorized version of the image. A user may apply thecolor values to portions of the image. In another embodiment, the inputmap is segmentation data for an image in a video sequence, thetask-specific affinity values are motion affinity values, and therefined map data is segmentation data for a subsequent image in thevideo sequence. In yet another embodiment, the spatial linearpropagation network system 100 is trained to perform affinity-basedediting, where the input map includes a value associated with a subsetof the pixels within an image and the refined map data includes a regionof the image with pixels set to the value, the region including thesubset of the pixels and additional pixels determined according to thetask-specific affinity values.

Switchable Propagation Neural Network

While the spatial linear propagation network system 100 performs spatialpropagation of pixels for image segmentation, a temporal linearpropagation network system may learn pixel affinity in another domain,specifically, the video domain. Videos contain highly redundantinformation between frames. Such redundancy has been studied extensivelyin video compression and encoding, but is less explored for moreadvanced video processing. A learnable unified framework is describedfor propagating a variety of visual properties of video images,including but not limited to color, high dynamic range (HDR), andsegmentation mask, where the property is available for only a fewkey-frames and is propagated to other frames for which the property isnot available.

A temporal propagation network (TPN) system learns the affinity matrixfor video image processing tasks. The TPN models the transition-relatedaffinity between a pair of frames in a purely data-driven manner. Anaffinity matrix is a generic matrix that defines the similarity of twopoints in space or time. Well-modeled affinity reveals how to propagateinformation, such as visual properties, from the pixels for which theproperty is known to pixels for which the property is not known.Examples of visual properties that may be propagated from a key-framerepresented by dense data (e.g., color, high-dynamic range, segmentationmask, etc.), to another frame that is represented by sparse data (e.g.,grey-scale, low-dynamic range, no segmentation, etc.). The TPN system istrained for a particular computer vision task (e.g. color propagation,dynamic range propagation, segmentation mask propagation, etc.).

FIG. 2A illustrates a block diagram of a temporal propagation network(TPN) system 200, in accordance with an embodiment. Although the TPNsystem 200 is described in the context of a neural network model, theTPN system 200 may also be performed by a program, custom circuitry, orby a combination of custom circuitry and a program. For example, the TPNsystem 200 may be implemented using a GPU (graphics processing unit),CPU (central processing unit), or any processor capable of performingthe operations described herein. Furthermore, persons of ordinary skillin the art will understand that any system that performs the operationsof the TPN system 200 is within the scope and spirit of embodiments ofthe present invention.

As shown in FIG. 2A, the TPN system 200 includes a guidance neuralnetwork model 220 and a temporal propagation module 205. Inputs to theTPN system 200 are key-frame task-specific data (e.g., definingattributes of pixels) for a key-frame (k) of a video sequence, key-frameproperty data, and task-specific data for a frame (k+τ) of the videosequence, where τ is a time before or after the key-frame. Examples oftask-specific data include per pixel lightness or greyscale, LDR, andRGB color, for the tasks of colorization, conversion to HDR, andsegmentation, respectively. The property data may be color data, HDRdata, or a segmentation mask. The TPN system 200 propagates the propertydata for the key-frame to one or more other frames corresponding to thetask-specific data.

The guidance neural network model 220 generates an affinity matrixreferred to as a global transformation matrix (guidance data) from thetask-specific data for the key-frame and the task-specific data for theframe. The global transformation matrix defines task-specific transitionaffinity values for the task of colorization, conversion to HDR, orsegmentation to propagate the property data from the key-frame to one ormore other frames in the video sequence. Thus, the TPN system 200 may beused to colorize several frames of greyscale video using a singlemanually colorized key-frame. In an embodiment, the guidance neuralnetwork model 220 is a deep CNN. The temporal propagation module 205applies the global transformation matrix (G, defining weights orcoefficients) to the key-frame property data to produce propagatedproperty data for the frame. Moreover, a single TPN system 200 maypropagate property data for each frame in sequence or multiple TPNsystems 200 may propagate property data for multiple frames in parallel.

The TPN system 200 is trained for a particular computer vision task.During training the computer vision task, parameters of the guidanceneural network model 220, and coefficients used for propagation in thetemporal propagation module 205 are determined. In particular,parameters for generating the global transformation matrix G for aparticular computer vision task are learned during training.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay be implemented, per the desires of the user. It should be stronglynoted that the following information is set forth for illustrativepurposes and should not be construed as limiting in any manner. Any ofthe following features may be optionally incorporated with or withoutthe exclusion of other features described.

Conventionally, colorization in images and videos is achieved via aninteractive procedure, which propagates manually annotated strokesspatially within or across frames, based on a matteing Laplacian matrixand with manually defined similarities. While interactive techniques canbe employed for single images, it is not practical to manually annotateall frames of a monochromatic video. The colorization task can beequivalently reformulated as propagating a target property (i.e., color)based on the affinity of some task-specific data (e.g., lightness)between two frames. Intuitively, propagation of the color property isfeasible because (1) videos have redundancy over time nearby frames tendto have similar appearance, and (2) the pixel correlation between twoframes in the lightness domain is often consistent with that in thecolor domain. Therefore, when property propagation is used, colorizing afull video can be achieved by annotating at sparse locations in only afew key-frames. With temporal propagation implemented by the TPN system200, a workload of black-and-white video colorization can be largelyreduced to only annotating a small number of key-frames and using thesmall number of color key-frames to propagate visual information to allframes in between the key-frames. Because the video properties betweentemporally close frames are highly redundant, the relationships betweenpairs of frames can be learned. In an embodiment, temporally closeframes are frames within the same scene or frames captures from a commonviewpoint or camera position.

The temporal propagation implemented by the TPN system 200, may also beused to generate HDR video images. Most consumer-grade digital camerashave limited dynamic range and often capture images withunder/over-exposed regions, which not only degrades the quality of thecaptured photographs and videos, but also impairs the performance ofcomputer vision tasks in numerous applications. A conventional way toachieve HDR imaging is to capture a stack of LDR images with differentexposures and to fuse the LDR images together. Such an approach assumesstatic scenes and thus requires de-ghosting techniques to removeartifacts. Capturing HDR videos for dynamic scenes poses a morechallenging problem. Conventional techniques to create HDR videos aremainly based on hardware that either alternate exposures between frames,uses multiple cameras, or uses specialized image sensors with pixel-wiseexposure controls.

The TPN system 200 may be used to reconstruct an HDR video from an LDRvideo. Given a few HDR key-frames and an LDR video, the TPN system 200propagates task-specific data comprising scene radiance information fromthe key-frames to the remaining frames. Note that unlike all theexisting single LDR-based techniques, that hallucinate the missing HDRdetails in images, the HDR information is instead propagated from a fewHDR images input to the TPN system 200 to neighboring LDR frames.Therefore, the TPN system 200 provides an alternative solution forefficient, low cost HDR video reconstruction from a few provided HDRframes. Similarly, video segmentation may be accomplished when only thesegmentation mask of the target in the first frame is provided. Evenwithout any image-based segmentation model, the TPN system 200 canachieve comparable performance to the state-of-the-art algorithm.

FIG. 2B illustrates a flowchart of a method 225 for propagating propertydata using the system shown in FIG. 2A, in accordance with anembodiment. Although method 225 is described in the context of aprocessing unit, the method 225 may also be performed by a program,custom circuitry, or by a combination of custom circuitry and a program.For example, the method 225 may be executed by a GPU (graphicsprocessing unit), CPU (central processing unit), or any processorcapable of performing the temporal propagation operations. Furthermore,persons of ordinary skill in the art will understand that any systemthat performs method 225 is within the scope and spirit of embodimentsof the present invention.

At step 226, task-specific data is received for a key-frame of a videosequence, where the task-specific data defines attributes of pixels inthe key-frame. At step 227, task-specific data for a frame of the videosequence is received, where the task-specific data defines attributes ofpixels in the frame.

At step 228, the guidance neural network model 220 processes, accordingto parameters, the task-specific data for the key-frame and thetask-specific data for the frame to produce guidance data for a task. Inan embodiment, the guidance data comprises task-specific affinity valuesfor transitions from the key-frame to other frames in the video sequenceincluding the frame. In an embodiment, the guidance data comprises aglobal transformation matrix that is regularized as orthogonal. In anembodiment, the guidance data preserves a style energy of the propertydata for the key-frame in the generated property data for the frame.

At step 229, the temporal propagation module 205 applies the guidancedata to property data for the key-frame to generate property data forthe frame. In an embodiment, the guidance neural network model 220 isjointly trained with the temporal propagation module 205 using atraining dataset for the task.

In an embodiment, the task is colorization, the attributes are lightnessdata, the property data for the key-frame is color data corresponding tothe key-frame and the property data for the frame comprises color datacorresponding to the frame. In an embodiment, the task is conversion tohigh dynamic range, the attributes are low dynamic range data, theproperty data for the key-frame is high dynamic range data correspondingto the key-frame and the property data for the frame comprises highdynamic range data corresponding to the frame. In an embodiment, thetask is segmentation, the attributes are color data, the property datafor the key-frame is segmentation data corresponding to the key-frameand the property data for the frame comprises segmentation datacorresponding to the frame.

The propagation of a target property (e.g., color) between two framesmay be modeled as a linear transformationU _(t) =GU _(k),  (7)where U_(k)∈

^(n) ² ^(×1) and U_(t)∈

^(n) ² ^(×1) are the vectorized version of the n×n property data (e.g.,property maps) of a key-frame and a nearby frame, and G∈

^(n) ² ^(×n) ² is the global transformation matrix to be estimated. Forproperty data with multiple channels n×n×c, each channel may be treatedseparately, so a separate global transformation matrix is estimated foreach channel. For some pixel attributes or features (e.g., lightness) ofthe two frames, V_(k) and V_(t), the global transformation matrix G is afunction of V_(k) and V_(t),G=g(θ,V _(k) ,V _(t)).  (8)

The global transformation matrix G should be dense in order to model anytype of pixel transition in a global scope, but G should also be concisefor efficient estimation and propagation. In an embodiment, the globaltransformation matrix is a linear transformation based on an imagediffusion process similar to the task-specific affinity values generatedby the guidance neural network model 120.

The diffusion process from frame k to frame t can be expressed with apartial differential equation (PDE) in the discrete form:∇U=U _(t) −U _(k) =−LU _(k)=(A−D)U _(k),  (9)where L=D−A is the Laplacian matrix, D is the diagonal degree matrix andA is the affinity matrix. For temporal propagation tasks, ∇U representsthe propagation of the property data U over time. Equation (9) can bere-written as U_(t)−(I−D+A) U_(k)=GU_(k), where G is the globaltransformation matrix between two frames, as defined in Equation (7),and I is an identity matrix.

With a propagation structure, such as provided by the spatial linearpropagation module 110, the diffusion between frames can be implementedas a linear propagation along the rows or columns of an image. Theequivalence between spatial linear propagation and temporal linearpropagation can be shown. The left-to-right spatial propagationoperation corresponding to equation (3) performed by the spatial linearpropagation module 110 is:y _(i)=(I−d _(i))x _(i) +w _(i) y _(i-1) , i∈[2,n],  (10)where x∈U_(k) and y∈U_(t), and the n×l vectors {x_(i), y_(i)} representthe i^(th) columns before and after propagation with an initialcondition of y₁=x₁, and w_(i) is the spatially varying n×n sub-matrix.Here, I is the identity matrix and d is a diagonal matrix, whose t^(th)element is the sum of all the elements of the t^(th) row of w_(i) asd_(i)(t,t)=Σ_(j=1,j≠1) ^(n)w_(i)(j,t). Similar to spatial linearpropagation, through (a) expanding the recursive term, and (b)concatenating all the rows/columns as a vectorized map, thetransformation matrix for spatial linear propagation is equivalent tothe global transformation matrix G between U_(k) and U_(t), where eachentry is the multiplication of several spatially variant w_(i).Essentially, instead of predicting all the entries in G as independentvariables, the propagation structure transfers the problem into learningeach sub-matrix w_(i) in equation (10), significantly reducing theoutput dimensions of G. In an embodiment, a separate sub-matrix w_(i) islearned for each propagation direction (e.g., left-to-right,right-to-left, etc.)

Note that the propagation in equation (7) is carried out for d=4directions independently. During training, the sub-matrices {w_(i)} ineach of the four directions are learned by the guidance neural networkmodel 220. For each direction, the guidance neural network model 220receives the key-frame task-specific data and frame task-specific data{V_(k), V_(t)} as inputs, and outputs a feature map P that has the samespatial size as U and constitutes the elements of the globaltransformation matrix G. Each pixel p_(i,j) in the feature map Pcontains all the values of the j^(th) row in w_(i), which describes alocal relation between the adjacent columns, but results in a globalconnection in G though the propagation structure in the temporalpropagation module 205. Similar to spatial propagation, only k=3 nearestneighbors from the previous column (or row) are needed, which results inw_(i) being a tridiagonal matrix. Thus, a total of n×n×(k×d) parametersare used to implement the global transformation matrix G. Such astructure significantly compresses the guidance information while stillensuring that the corresponding G is a dense matrix that can describeglobal and dense pairwise relationships between a pair of frames. Incomparison, without compression, G has a huge dimension (e.g., n²×n²),too large for a CNN to directly learn.

FIG. 2C illustrates a conceptual diagram of 3-way propagation fromleft-to-right, and right-to-left corresponding to a triangular matrixand a transposed triangular matrix, respectively, in accordance with anembodiment. The k=3 nearest neighbors from the previous column arelinearly propagated (to the right or to the left) to produce each pixel,which results in w_(i) being a tridiagonal matrix. Because thepropagation is directed, the transformation matrix G is a triangularmatrix. G corresponds to a left-to-right linear propagation of the k=3nearest neighbors from the previous column to produce each pixel. Thetransposed global transformation matrix G^(T) corresponds to propagationin the opposing direction, specifically a right-to-left linearpropagation of the k=3 nearest neighbors from the previous column toproduce each pixel.

Consider the two directions along the horizontal axis (i.e., →,←) inFIG. 2C. G is a lower-triangular matrix for a particular direction(e.g., →), while G^(T) is upper-triangular for the opposing direction(e.g., ←). Suppose P_(→) and P_(←) are the output feature maps of theguidance network with respect to the two opposing directions. Becausethe upper-triangular matrix G^(T) corresponds to propagating in theright-to-left direction and contains the same set of weight sub-matricesas G, switching the output channels of the guidance neural network model220 with respect to the opposite directions P_(→) and P_(←) in thetemporal propagation module 205 is equivalent to transposing thetransformation matrix G. Therefore, it is not necessary to compute thetransposed global transformation matrix G^(T).

The bi-directionality attribute of propagation is based on theassumption that properties in nearby video frames do not have a causalrelationship, and the assumption holds for most properties thatnaturally exist in the real-world, e.g., color and HDR. Hence, temporalpropagation of the properties in nearby video frames can often beswitched in direction without breaking the propagation process. Given aglobal transformation matrix G and a pair of frames {U₁, U₂}, a pair ofequations follows:U ₂ =G _(1→2) U ₁ U ₁ =G _(2→1) U ₂,  (11)where the arrow denotes the propagation direction. The bi-directionalityattribute implies that reversing the roles of the two frames as inputsby reversing the frame task-specific data {V₁, V₂}→{V₂, V₁} andreversing the corresponding supervision signals for propagation in thehorizontal direction and in the vertical direction corresponds toapplying an inverse transformation matrix G_(2→1)=G_(1→2) ⁻¹. When G isorthogonal, G_(2→1) can be replaced with G_(1→2) ^(T), which equalsG_(1→2) ⁻¹. G_(1→2) ^(T) is transposed with respect to G_(1→2), enablinga switchable temporal propagation architecture.

The bi-directional attribute is one of two unique characteristics ofpropagation in the temporal domain, which do not exist for propagationin the spatial domain. The second unique characteristic is that, duringpropagation, the overall “style” of the propagated property across theimage should stay constant between frames, e.g., during colorpropagation, the color saturation of all frames within a short videoclip should be similar. Maintaining a similar style is referred to asfeature “consistency property”. As described further herein, enforcingbi-directionality and consistency is equivalent to ensuring that thetransformation matrix G is orthogonal. Ensuring that the transformationmatrix G is orthogonal can be implemented by equipping an ordinarytemporal propagation network, such as the temporal propagation module205 with a switchable structure.

Style consistency refers to whether the generated frames can maintainsimilar chromatic properties or brightness when propagating color or HDRinformation, which is important for producing high-quality videoswithout the property vanishing over time. Global temporal consistency isensured by minimizing the difference in style loss of the propagatedproperty for the two frames. Conventionally, style loss has not beenused for regularizing temporal propagation. In an embodiment, the styleis represented by the Gram matrix, which is proportional to theun-centered covariance of the property map. The style loss is thesquared Frobenius norm of the difference between the Gram matrices ofthe key-frame and the succeeding frame:

Theorem 1. By regularizing the style loss, the following optimizationresults, with respect to the TPN system 200:

$\begin{matrix}{\min\frac{1}{N}{{{U_{1}^{T}U_{1}} - {U_{2}^{T}U_{2}}}}_{F}^{2}} & (12) \\{{s.t.\mspace{14mu} U_{2}} = {GU}_{1}} & (13)\end{matrix}$The optimal solution is reached when G is orthogonal.

Proof. Since the function (12) is non-negative, the minimum is reachedwhen U₁ ^(T)U₁=U₂ ^(T)U₂. Combining equation (12) with equation (13)produces G^(T)G=I. Note that, even when a channel-wise propagation isused, where the U^(T)U actually reduces to an uncentered variance, theconclusions of Theorem 1 still hold.

Given that G is orthogonal, the G_(2→1) in equation (11) can be replacedby G_(1→2) ^(T), which equals G_(1→2) ⁻¹. Therefore, thebi-directionality propagation can be represented via a pair oftransformation matrices that are transposed with respect to each other.The bidirectional property and transposed transformation matrix Grelationship may be incorporated into the linear propagation network viaa special network architecture.

FIG. 2D illustrates a conceptual diagram of forward propagation andswitching the sets of weight sub-matrices to implement reversepropagation, in accordance with an embodiment. For forward propagation,the task-specific property data for U₁ are propagated to U₂. For reversepropagation, the task-specific property data for U₂ are propagated toU₁. The corresponding supervision signals for propagation (e.g., set ofweight sub-matrices) are reversed in the horizontal and verticaldirections by the switchable structure to implement reverse propagation.Therefore, the forward propagation path implements U₁=G_(2→1)U₂ and thereverse propagation path implements U₂=_(1→2)U₁.

FIG. 2E illustrates a block diagram of a bi-directional trainingconfiguration for a switchable TPN system 230, in accordance with anembodiment. The switchable TPN system 230 includes the guidance neuralnetwork model 220, switchable temporal propagation modules 210-A and210-B, and a loss function 215. Although the switchable TPN system 230is described in the context of a neural network model, the switchableTPN system 230 may also be performed by a program, custom circuitry, orby a combination of custom circuitry and a program. For example, theswitchable TPN system 230 may be implemented using a GPU (graphicsprocessing unit), CPU (central processing unit), or any processorcapable of performing the operations described herein. Furthermore,persons of ordinary skill in the art will understand that any systemthat performs the operations of the switchable TPN system 230 is withinthe scope and spirit of embodiments of the present invention.

The guidance neural network model 220 is trained jointly with switchabletemporal propagation modules 210 to learn affinity for a computer visiontask. The training dataset comprises task-specific data for pairs offrames and ground truth property data for the pairs of frames. A firstframe in the pair may correspond to a key-frame in a video sequence anda second frame in each pair may correspond to another frame in the videosequence.

The guidance neural network model 220 receives the task-specific data{V₁, V₂} for a first frame (U₁) and a second frame (U₂), and outputs allelements (P) that constitute the global transformation matrix G_(1→2)(task-specific transition affinity values). The switchable temporalpropagation module 210-A receives G_(1→2) and ground truth property datafor the first frame and applies G_(1→2) to generate the propagatedproperty data for the second frame. In an embodiment, the property datais a property map. The switchable temporal propagation module 210-Acorresponds to the temporal propagation module 110 in FIG. 2A. In anembodiment, the switchable temporal propagation module 210-A and thetemporal propagation module 205 are functionally equivalent.

The second switchable temporal propagation module 210-B receives G_(1→2)and ground truth property data for the second frame (U₂) and generatespropagated property data for the first frame (U₁). The second switchabletemporal propagation module 210-B is only needed during training and isconfigured to apply the inverse transformation matrix G_(2→1)=G_(1→2)⁻¹=G_(1→2) ^(T) to the ground truth property data by reversing thecorresponding supervision signals, as shown in the switchable structureof FIG. 2D. An inverse signal may be used to configure the switchabletemporal propagation module 210-B to reverse the supervision signals. Inone embodiment, the propagation directions for the switchable temporalpropagation module 210-A may be horizontal left-to-right (columns),horizontal right-to-left (columns), vertical top-to-bottom (rows), andvertical bottom-to-top (rows) and within the switchable temporalpropagation module 210-B channels for the horizontal propagationdirections are switched and channels for the vertical propagationdirections are switched (e.g., swapped or reversed).

The loss function 215 receives the ground truth property data for thefirst and second frames. Within the training dataset, the ground truthproperty data for the first and second frames is paired with thetask-specific data {V₁, V₂} for the first and second frames. The lossfunction 215 also receives and the propagated property data for thefirst and second frames and computes updates for parameters of theguidance neural network model 220 and coefficients of the switchabletemporal propagation modules 210. The updated parameters andcoefficients are computed to reduce differences between the ground truthproperty data and the propagated property data for the first frame andreduce differences between the ground truth property data and thepropagated property data for the second frame.

In an embodiment, nodewise max-pooling is used to integrate the hiddenlayers within the guidance neural network model 220 and to obtain thefinal propagation result. In an embodiment, all submodules within theguidance neural network model 220 and the switchable temporalpropagation modules 210 are differentiable and jointly trained usingstochastic gradient descent (SGD), with the base learning rate of 10⁻⁵.

FIG. 2D illustrates how the switchable structure of the switchabletemporal propagation module 210 is exploited as an additionalregularization loss term during training. For each pair (U₁, U₂) of thetraining data, the first term in equation (14) shows the regularsupervised loss between the propagated property data predicted by theswitchable temporal propagation module 210-A and the ground truthproperty data. In addition, as shown in FIG. 2E, because thebi-directionality and the style consistency is enforced in theswitchable TPN system 230, the switchable temporal propagation module210-B is configured to propagate from U₂ back to U₁ by simply switchingthe channels of the output of the guidance neural network model 220,i.e., switching the channels of {P→, P←} and {P↓, P↑} for propagatinginformation in the opposite direction. Switching the channels form thesecond loss term in equation (14), which serves as a regularization(weighted by X) during the training. In an embodiment, λ=0.1.L(U ₁ ,Û ₁ ,U ₂ ,Û ₂)=∥U ₂(i)−Û ₂(i)∥² +λ∥U ₁(i)−Û ₁(i)∥².  (14)The loss function 215 may be configured to minimize the loss computedaccording to equation 14. During training, parameters of the guidanceneural network model 220 and the coefficients used for propagation inthe temporal propagation neural network modules 210 are determined bythe loss function 215. At inference time, the switchable TPN system 230reduces to the basic TPN system 200 and therefore does not have anyextra computational expense.

Compared to conventional techniques, the TPN system 200 and switchableTPN system 230 significantly improves video quality. Importantly, theswitchable temporal propagation module 210 preserves the style energybetter than the temporal propagation module 205 without the switchablestructure. Additionally, the TPN system 200 using the switchabletemporal propagation module 210 executes in real-time on a single GPUfor each of the computer vision tasks. The TPN system 200 using thetemporal propagation module 205 or the switchable TPN system 230 usingswitchable temporal propagation module 210 may be configured topropagate property data for each frame in sequence or multiple TPNsystems 200 may be used in parallel to propagate property data for oneor more video frames in parallel, further improving efficiency.

FIG. 2F illustrates a flowchart of a method 240 for training theswitchable TPN system 230 shown in FIG. 2E, in accordance with anembodiment. Although method 240 is described in the context of aprocessing unit, the method 240 may also be performed by a program,custom circuitry, or by a combination of custom circuitry and a program.For example, the method 240 may be executed by a GPU (graphicsprocessing unit), CPU (central processing unit), or any processorcapable of performing the temporal propagation operations. Furthermore,persons of ordinary skill in the art will understand that any systemthat performs method 240 is within the scope and spirit of embodimentsof the present invention.

At step 235, the switchable TPN system 230 receives ground truthproperty data for a key-frame of a video sequence defining values of aproperty of each pixel in the first frame. At step 237, the switchableTPN system 230 receives ground truth property data for a second frame ofthe video sequence defining values of the property of each pixel in thesecond frame.

At step 242, the switchable temporal propagation modules 210-A and 210-Breceive task-specific affinity values for transitions from the firstframe to the second frame. In an embodiment, the guidance neural networkmodel 220 generates the task-specific affinity values for a task basedon task-specific data for the first frame defining values of anattribute of pixels in the first frame and task-specific data for thesecond frame defining values of the attribute of pixels in the secondframe. In an embodiment, the task-specific affinity values comprise aglobal transformation matrix. In an embodiment, the guidance neuralnetwork model 220 is jointly trained with the switchable temporalpropagation module 210-A and the switchable temporal propagation module210-B using a training dataset for the task.

At step 245, the switchable temporal propagation module 210-A processesthe ground truth property data for the first frame and the task-specificaffinity values to produce property data for the second frame in thevideo sequence. At step 250, the switchable temporal propagation module210-B processes the ground truth property data for the second frame andthe task-specific affinity values to produce property data for the firstframe. In an embodiment, the switchable temporal propagation module210-B is configured to produce the property data for the first frameaccording to an inverse transformation matrix corresponding to theglobal transformation matrix. In an embodiment, the inversetransformation matrix and the global transformation matrix areorthogonal when the differences between a style energy of the groundtruth property data for the second frame and a style energy of theproperty data for the second frame are minimized.

At step 255, the switchable TPN system 230 updates coefficients of theswitchable temporal propagation module 210-A to reduce differencesbetween the ground truth property data for the second frame and theproperty data for the second frame. In an embodiment, the switchable TPNsystem 230 updates coefficients of the switchable temporal propagationmodule 210-B to reduce differences between the ground truth propertydata for the first frame and the property data for the first frame. Inan embodiment, the switchable TPN system 230 updates weights of theguidance neural network model 220 to reduce differences between theground truth property data for the second frame and the property datafor the second frame. In an embodiment, the switchable TPN system 230updates weights of the guidance neural network model 220 to reducedifferences between the ground truth property data for the first frameand the property data for the first frame. In an embodiment, theswitchable TPN system 230 updates parameters of the guidance neuralnetwork model 220 to reduce differences between a style energy of theground truth property data for the second frame and a style energy ofthe property data for the second frame.

In an embodiment, the switchable TPN system 230 enforces thebi-directionality, i.e., the propagation between a pair of frames shouldbe invertible, and the style consistency i.e., the “style energy” (e.g.,the global saturation of color) of the target property should bepreserved during temporal propagation. Enforcing these two principles isequivalent to ensuring the triangular transformation matrix G isorthogonal, enabling a switchable implementation of the temporalpropagation module 210 to perform forward and reverse propagation duringtraining to learn the global transformation matrix.

Enforcing both principles in the switchable TPN system 230 is equivalentto ensuring that the transformation matrix is orthogonal with respect toeach propagation direction. The theoretical result allows implementationof the temporal propagation module 205 as a special architecture theswitchable temporal propagation module 210 without explicitly solvingfor the transformation matrix. The switchable TPN system 230 iseffective in preserving the style energy even between two widelyseparated frames. Ensuring bi-directionality and style consistency, isequivalent to regularizing the global transformation matrix asorthogonal. Advantageously, the global transformation matrix need not beexplicitly solved.

The switchable TPN system 230 may be applied to at least three tasks:colorizing a gray-scale video based on a few colored key-frames,generating an HDR video from a low dynamic range (LDR) video and a fewHDR frames, and propagating a segmentation mask from the first frame invideos. Experimental results show that training the TPN system 200 usingthe the switchable TPN system 230 configuration produces a TPN system200 that is significantly more accurate and efficient than conventionalsystems for propagating property data.

Parallel Processing Architecture

FIG. 3 illustrates a parallel processing unit (PPU) 300, in accordancewith an embodiment. In an embodiment, the PPU 300 is a multi-threadedprocessor that is implemented on one or more integrated circuit devices.The PPU 300 is a latency hiding architecture designed to process manythreads in parallel. A thread (i.e., a thread of execution) is aninstantiation of a set of instructions configured to be executed by thePPU 300. In an embodiment, the PPU 300 is a graphics processing unit(GPU) configured to implement a graphics rendering pipeline forprocessing three-dimensional (3D) graphics data in order to generatetwo-dimensional (2D) image data for display on a display device such asa liquid crystal display (LCD) device. In other embodiments, the PPU 300may be utilized for performing general-purpose computations. While oneexemplary parallel processor is provided herein for illustrativepurposes, it should be strongly noted that such processor is set forthfor illustrative purposes only, and that any processor may be employedto supplement and/or substitute for the same.

One or more PPUs 300 may be configured to accelerate thousands of HighPerformance Computing (HPC), data center, and machine learningapplications. The PPU 300 may be configured to accelerate numerous deeplearning systems and applications including autonomous vehicleplatforms, deep learning, high-accuracy speech, image, and textrecognition systems, intelligent video analytics, molecular simulations,drug discovery, disease diagnosis, weather forecasting, big dataanalytics, astronomy, molecular dynamics simulation, financial modeling,robotics, factory automation, real-time language translation, onlinesearch optimizations, and personalized user recommendations, and thelike.

As shown in FIG. 3, the PPU 300 includes an Input/Output (I/O) unit 305,a front end unit 315, a scheduler unit 320, a work distribution unit325, a hub 330, a crossbar (Xbar) 370, one or more general processingclusters (GPCs) 350, and one or more partition units 380. The PPU 300may be connected to a host processor or other PPUs 300 via one or morehigh-speed NVLink 310 interconnect. The PPU 300 may be connected to ahost processor or other peripheral devices via an interconnect 302. ThePPU 300 may also be connected to a local memory comprising a number ofmemory devices 304. In an embodiment, the local memory may comprise anumber of dynamic random access memory (DRAM) devices. The DRAM devicesmay be configured as a high-bandwidth memory (HBM) subsystem, withmultiple DRAM dies stacked within each device.

The NVLink 310 interconnect enables systems to scale and include one ormore PPUs 300 combined with one or more CPUs, supports cache coherencebetween the PPUs 300 and CPUs, and CPU mastering. Data and/or commandsmay be transmitted by the NVLink 310 through the hub 330 to/from otherunits of the PPU 300 such as one or more copy engines, a video encoder,a video decoder, a power management unit, etc. (not explicitly shown).The NVLink 310 is described in more detail in conjunction with FIG. 5B.

The I/O unit 305 is configured to transmit and receive communications(i.e., commands, data, etc.) from a host processor (not shown) over theinterconnect 302. The I/O unit 305 may communicate with the hostprocessor directly via the interconnect 302 or through one or moreintermediate devices such as a memory bridge. In an embodiment, the I/Ounit 305 may communicate with one or more other processors, such as oneor more the PPUs 300 via the interconnect 302. In an embodiment, the I/Ounit 305 implements a Peripheral Component Interconnect Express (PCIe)interface for communications over a PCIe bus and the interconnect 302 isa PCIe bus. In alternative embodiments, the I/O unit 305 may implementother types of well-known interfaces for communicating with externaldevices.

The I/O unit 305 decodes packets received via the interconnect 302. Inan embodiment, the packets represent commands configured to cause thePPU 300 to perform various operations. The I/O unit 305 transmits thedecoded commands to various other units of the PPU 300 as the commandsmay specify. For example, some commands may be transmitted to the frontend unit 315. Other commands may be transmitted to the hub 330 or otherunits of the PPU 300 such as one or more copy engines, a video encoder,a video decoder, a power management unit, etc. (not explicitly shown).In other words, the I/O unit 305 is configured to route communicationsbetween and among the various logical units of the PPU 300.

In an embodiment, a program executed by the host processor encodes acommand stream in a buffer that provides workloads to the PPU 300 forprocessing. A workload may comprise several instructions and data to beprocessed by those instructions. The buffer is a region in a memory thatis accessible (i.e., read/write) by both the host processor and the PPU300. For example, the I/O unit 305 may be configured to access thebuffer in a system memory connected to the interconnect 302 via memoryrequests transmitted over the interconnect 302. In an embodiment, thehost processor writes the command stream to the buffer and thentransmits a pointer to the start of the command stream to the PPU 300.The front end unit 315 receives pointers to one or more command streams.The front end unit 315 manages the one or more streams, reading commandsfrom the streams and forwarding commands to the various units of the PPU300.

The front end unit 315 is coupled to a scheduler unit 320 thatconfigures the various GPCs 350 to process tasks defined by the one ormore streams. The scheduler unit 320 is configured to track stateinformation related to the various tasks managed by the scheduler unit320. The state may indicate which GPC 350 a task is assigned to, whetherthe task is active or inactive, a priority level associated with thetask, and so forth. The scheduler unit 320 manages the execution of aplurality of tasks on the one or more GPCs 350.

The scheduler unit 320 is coupled to a work distribution unit 325 thatis configured to dispatch tasks for execution on the GPCs 350. The workdistribution unit 325 may track a number of scheduled tasks receivedfrom the scheduler unit 320. In an embodiment, the work distributionunit 325 manages a pending task pool and an active task pool for each ofthe GPCs 350. The pending task pool may comprise a number of slots(e.g., 32 slots) that contain tasks assigned to be processed by aparticular GPC 350. The active task pool may comprise a number of slots(e.g., 4 slots) for tasks that are actively being processed by the GPCs350. As a GPC 350 finishes the execution of a task, that task is evictedfrom the active task pool for the GPC 350 and one of the other tasksfrom the pending task pool is selected and scheduled for execution onthe GPC 350. If an active task has been idle on the GPC 350, such aswhile waiting for a data dependency to be resolved, then the active taskmay be evicted from the GPC 350 and returned to the pending task poolwhile another task in the pending task pool is selected and scheduledfor execution on the GPC 350.

The work distribution unit 325 communicates with the one or more GPCs350 via XBar 370. The XBar 370 is an interconnect network that couplesmany of the units of the PPU 300 to other units of the PPU 300. Forexample, the XBar 370 may be configured to couple the work distributionunit 325 to a particular GPC 350. Although not shown explicitly, one ormore other units of the PPU 300 may also be connected to the XBar 370via the hub 330.

The tasks are managed by the scheduler unit 320 and dispatched to a GPC350 by the work distribution unit 325. The GPC 350 is configured toprocess the task and generate results. The results may be consumed byother tasks within the GPC 350, routed to a different GPC 350 via theXBar 370, or stored in the memory 304. The results can be written to thememory 304 via the partition units 380, which implement a memoryinterface for reading and writing data to/from the memory 304. Theresults can be transmitted to another PPU 304 or CPU via the NVLink 310.In an embodiment, the PPU 300 includes a number U of partition units 380that is equal to the number of separate and distinct memory devices 304coupled to the PPU 300. A partition unit 380 will be described in moredetail below in conjunction with FIG. 4B.

In an embodiment, a host processor executes a driver kernel thatimplements an application programming interface (API) that enables oneor more applications executing on the host processor to scheduleoperations for execution on the PPU 300. In an embodiment, multiplecompute applications are simultaneously executed by the PPU 300 and thePPU 300 provides isolation, quality of service (QoS), and independentaddress spaces for the multiple compute applications. An application maygenerate instructions (i.e., API calls) that cause the driver kernel togenerate one or more tasks for execution by the PPU 300. The driverkernel outputs tasks to one or more streams being processed by the PPU300. Each task may comprise one or more groups of related threads,referred to herein as a warp. In an embodiment, a warp comprises 32related threads that may be executed in parallel. Cooperating threadsmay refer to a plurality of threads including instructions to performthe task and that may exchange data through shared memory. Threads andcooperating threads are described in more detail in conjunction withFIG. 5A.

FIG. 4A illustrates a GPC 350 of the PPU 300 of FIG. 3, in accordancewith an embodiment. As shown in FIG. 4A, each GPC 350 includes a numberof hardware units for processing tasks. In an embodiment, each GPC 350includes a pipeline manager 410, a pre-raster operations unit (PROP)415, a raster engine 425, a work distribution crossbar (WDX) 480, amemory management unit (MMU) 490, and one or more Data ProcessingClusters (DPCs) 420. It will be appreciated that the GPC 350 of FIG. 4Amay include other hardware units in lieu of or in addition to the unitsshown in FIG. 4A.

In an embodiment, the operation of the GPC 350 is controlled by thepipeline manager 410. The pipeline manager 410 manages the configurationof the one or more DPCs 420 for processing tasks allocated to the GPC350. In an embodiment, the pipeline manager 410 may configure at leastone of the one or more DPCs 420 to implement at least a portion of agraphics rendering pipeline. For example, a DPC 420 may be configured toexecute a vertex shader program on the programmable streamingmultiprocessor (SM) 440. The pipeline manager 410 may also be configuredto route packets received from the work distribution unit 325 to theappropriate logical units within the GPC 350. For example, some packetsmay be routed to fixed function hardware units in the PROP 415 and/orraster engine 425 while other packets may be routed to the DPCs 420 forprocessing by the primitive engine 435 or the SM 440. In an embodiment,the pipeline manager 410 may configure at least one of the one or moreDPCs 420 to implement a neural network model and/or a computingpipeline.

The PROP unit 415 is configured to route data generated by the rasterengine 425 and the DPCs 420 to a Raster Operations (ROP) unit, describedin more detail in conjunction with FIG. 4B. The PROP unit 415 may alsobe configured to perform optimizations for color blending, organizepixel data, perform address translations, and the like.

The raster engine 425 includes a number of fixed function hardware unitsconfigured to perform various raster operations. In an embodiment, theraster engine 425 includes a setup engine, a coarse raster engine, aculling engine, a clipping engine, a fine raster engine, and a tilecoalescing engine. The setup engine receives transformed vertices andgenerates plane equations associated with the geometric primitivedefined by the vertices. The plane equations are transmitted to thecoarse raster engine to generate coverage information (e.g., an x,ycoverage mask for a tile) for the primitive. The output of the coarseraster engine is transmitted to the culling engine where fragmentsassociated with the primitive that fail a z-test are culled, andtransmitted to a clipping engine where fragments lying outside a viewingfrustum are clipped. Those fragments that survive clipping and cullingmay be passed to the fine raster engine to generate attributes for thepixel fragments based on the plane equations generated by the setupengine. The output of the raster engine 425 comprises fragments to beprocessed, for example, by a fragment shader implemented within a DPC420.

Each DPC 420 included in the GPC 350 includes an M-Pipe Controller (MPC)430, a primitive engine 435, and one or more SMs 440. The MPC 430controls the operation of the DPC 420, routing packets received from thepipeline manager 410 to the appropriate units in the DPC 420. Forexample, packets associated with a vertex may be routed to the primitiveengine 435, which is configured to fetch vertex attributes associatedwith the vertex from the memory 304. In contrast, packets associatedwith a shader program may be transmitted to the SM 440.

The SM 440 comprises a programmable streaming processor that isconfigured to process tasks represented by a number of threads. Each SM440 is multi-threaded and configured to execute a plurality of threads(e.g., 32 threads) from a particular group of threads concurrently. Inan embodiment, the SM 440 implements a SIMD (Single-Instruction,Multiple-Data) architecture where each thread in a group of threads(i.e., a warp) is configured to process a different set of data based onthe same set of instructions. All threads in the group of threadsexecute the same instructions. In another embodiment, the SM 440implements a SIMT (Single-Instruction, Multiple Thread) architecturewhere each thread in a group of threads is configured to process adifferent set of data based on the same set of instructions, but whereindividual threads in the group of threads are allowed to diverge duringexecution. In an embodiment, a program counter, call stack, andexecution state is maintained for each warp, enabling concurrencybetween warps and serial execution within warps when threads within thewarp diverge. In another embodiment, a program counter, call stack, andexecution state is maintained for each individual thread, enabling equalconcurrency between all threads, within and between warps. Whenexecution state is maintained for each individual thread, threadsexecuting the same instructions may be converged and executed inparallel for maximum efficiency. The SM 440 will be described in moredetail below in conjunction with FIG. 5A.

The MMU 490 provides an interface between the GPC 350 and the partitionunit 380. The MMU 490 may provide translation of virtual addresses intophysical addresses, memory protection, and arbitration of memoryrequests. In an embodiment, the MMU 490 provides one or more translationlookaside buffers (TLBs) for performing translation of virtual addressesinto physical addresses in the memory 304.

FIG. 4B illustrates a memory partition unit 380 of the PPU 300 of FIG.3, in accordance with an embodiment. As shown in FIG. 4B, the memorypartition unit 380 includes a Raster Operations (ROP) unit 450, a leveltwo (L2) cache 460, and a memory interface 470. The memory interface 470is coupled to the memory 304. Memory interface 470 may implement 32, 64,128, 1024-bit data buses, or the like, for high-speed data transfer. Inan embodiment, the PPU 300 incorporates one memory interface 470 perpair of partition units 380, where each pair of partition units 380 isconnected to a corresponding memory device 304. For example, PPU 300 maybe connected to up to Y memory devices 304, such as high bandwidthmemory stacks or graphics double-data-rate, version 5, synchronousdynamic random access memory, or other types of persistent storage.

In an embodiment, the memory interface 470 implements an HBM2 memoryinterface and Y equals half U. In an embodiment, the HBM2 memory stacksare located on the same physical package as the PPU 300, providingsubstantial power and area savings compared with conventional GDDR5SDRAM systems. In an embodiment, each HBM2 stack includes four memorydies and Y equals 4, with HBM2 stack including two 128-bit channels perdie for a total of 8 channels and a data bus width of 1024 bits.

In an embodiment, the memory 304 supports Single-Error CorrectingDouble-Error Detecting (SECDED) Error Correction Code (ECC) to protectdata. ECC provides higher reliability for compute applications that aresensitive to data corruption. Reliability is especially important inlarge-scale cluster computing environments where PPUs 300 process verylarge datasets and/or run applications for extended periods.

In an embodiment, the PPU 300 implements a multi-level memory hierarchy.In an embodiment, the memory partition unit 380 supports a unifiedmemory to provide a single unified virtual address space for CPU and PPU300 memory, enabling data sharing between virtual memory systems. In anembodiment the frequency of accesses by a PPU 300 to memory located onother processors is traced to ensure that memory pages are moved to thephysical memory of the PPU 300 that is accessing the pages morefrequently. In an embodiment, the NVLink 310 supports addresstranslation services allowing the PPU 300 to directly access a CPU'spage tables and providing full access to CPU memory by the PPU 300.

In an embodiment, copy engines transfer data between multiple PPUs 300or between PPUs 300 and CPUs. The copy engines can generate page faultsfor addresses that are not mapped into the page tables. The memorypartition unit 380 can then service the page faults, mapping theaddresses into the page table, after which the copy engine can performthe transfer. In a conventional system, memory is pinned (i.e.,non-pageable) for multiple copy engine operations between multipleprocessors, substantially reducing the available memory. With hardwarepage faulting, addresses can be passed to the copy engines withoutworrying if the memory pages are resident, and the copy process istransparent.

Data from the memory 304 or other system memory may be fetched by thememory partition unit 380 and stored in the L2 cache 460, which islocated on-chip and is shared between the various GPCs 350. As shown,each memory partition unit 380 includes a portion of the L2 cache 460associated with a corresponding memory device 304. Lower level cachesmay then be implemented in various units within the GPCs 350. Forexample, each of the SMs 440 may implement a level one (L1) cache. TheL1 cache is private memory that is dedicated to a particular SM 440.Data from the L2 cache 460 may be fetched and stored in each of the L1caches for processing in the functional units of the SMs 440. The L2cache 460 is coupled to the memory interface 470 and the XBar 370.

The ROP unit 450 performs graphics raster operations related to pixelcolor, such as color compression, pixel blending, and the like. The ROPunit 450 also implements depth testing in conjunction with the rasterengine 425, receiving a depth for a sample location associated with apixel fragment from the culling engine of the raster engine 425. Thedepth is tested against a corresponding depth in a depth buffer for asample location associated with the fragment. If the fragment passes thedepth test for the sample location, then the ROP unit 450 updates thedepth buffer and transmits a result of the depth test to the rasterengine 425. It will be appreciated that the number of partition units380 may be different than the number of GPCs 350 and, therefore, eachROP unit 450 may be coupled to each of the GPCs 350. The ROP unit 450tracks packets received from the different GPCs 350 and determines whichGPC 350 that a result generated by the ROP unit 450 is routed to throughthe Xbar 370. Although the ROP unit 450 is included within the memorypartition unit 380 in FIG. 4B, in other embodiment, the ROP unit 450 maybe outside of the memory partition unit 380. For example, the ROP unit450 may reside in the GPC 350 or another unit.

FIG. 5A illustrates the streaming multi-processor 440 of FIG. 4A, inaccordance with an embodiment. As shown in FIG. 5A, the SM 440 includesan instruction cache 505, one or more scheduler units 510, a registerfile 520, one or more processing cores 550, one or more special functionunits (SFUs) 552, one or more load/store units (LSUs) 554, aninterconnect network 580, a shared memory/L1 cache 570.

As described above, the work distribution unit 325 dispatches tasks forexecution on the GPCs 350 of the PPU 300. The tasks are allocated to aparticular DPC 420 within a GPC 350 and, if the task is associated witha shader program, the task may be allocated to an SM 440. The schedulerunit 510 receives the tasks from the work distribution unit 325 andmanages instruction scheduling for one or more thread blocks assigned tothe SM 440. The scheduler unit 510 schedules thread blocks for executionas warps of parallel threads, where each thread block is allocated atleast one warp. In an embodiment, each warp executes 32 threads. Thescheduler unit 510 may manage a plurality of different thread blocks,allocating the warps to the different thread blocks and then dispatchinginstructions from the plurality of different cooperative groups to thevarious functional units (i.e., cores 550, SFUs 552, and LSUs 554)during each clock cycle.

Cooperative Groups is a programming model for organizing groups ofcommunicating threads that allows developers to express the granularityat which threads are communicating, enabling the expression of richer,more efficient parallel decompositions. Cooperative launch APIs supportsynchronization amongst thread blocks for the execution of parallelalgorithms. Conventional programming models provide a single, simpleconstruct for synchronizing cooperating threads: a barrier across allthreads of a thread block (i.e., the syncthreads( ) function). However,programmers would often like to define groups of threads at smaller thanthread block granularities and synchronize within the defined groups toenable greater performance, design flexibility, and software reuse inthe form of collective group-wide function interfaces.

Cooperative Groups enables programmers to define groups of threadsexplicitly at sub-block (i.e., as small as a single thread) andmulti-block granularities, and to perform collective operations such assynchronization on the threads in a cooperative group. The programmingmodel supports clean composition across software boundaries, so thatlibraries and utility functions can synchronize safely within theirlocal context without having to make assumptions about convergence.Cooperative Groups primitives enable new patterns of cooperativeparallelism, including producer-consumer parallelism, opportunisticparallelism, and global synchronization across an entire grid of threadblocks.

A dispatch unit 515 is configured to transmit instructions to one ormore of the functional units. In the embodiment, the scheduler unit 510includes two dispatch units 515 that enable two different instructionsfrom the same warp to be dispatched during each clock cycle. Inalternative embodiments, each scheduler unit 510 may include a singledispatch unit 515 or additional dispatch units 515.

Each SM 440 includes a register file 520 that provides a set ofregisters for the functional units of the SM 440. In an embodiment, theregister file 520 is divided between each of the functional units suchthat each functional unit is allocated a dedicated portion of theregister file 520. In another embodiment, the register file 520 isdivided between the different warps being executed by the SM 440. Theregister file 520 provides temporary storage for operands connected tothe data paths of the functional units.

Each SM 440 comprises L processing cores 550. In an embodiment, the SM440 includes a large number (e.g., 128, etc.) of distinct processingcores 550. Each core 550 may include a fully-pipelined,single-precision, double-precision, and/or mixed precision processingunit that includes a floating point arithmetic logic unit and an integerarithmetic logic unit. In an embodiment, the floating point arithmeticlogic units implement the IEEE 754-2008 standard for floating pointarithmetic. In an embodiment, the cores 550 include 64 single-precision(32-bit) floating point cores, 64 integer cores, 32 double-precision(64-bit) floating point cores, and 8 tensor cores.

Tensor cores configured to perform matrix operations, and, in anembodiment, one or more tensor cores are included in the cores 550. Inparticular, the tensor cores are configured to perform deep learningmatrix arithmetic, such as convolution operations for neural networktraining and inferencing. In an embodiment, each tensor core operates ona 4×4 matrix and performs a matrix multiply and accumulate operationD=A×B+C, where A, B, C, and D are 4×4 matrices.

In an embodiment, the matrix multiply inputs A and B are 16-bit floatingpoint matrices, while the accumulation matrices C and D may be 16-bitfloating point or 32-bit floating point matrices. Tensor Cores operateon 16-bit floating point input data with 32-bit floating pointaccumulation. The 16-bit floating point multiply requires 64 operationsand results in a full precision product that is then accumulated using32-bit floating point addition with the other intermediate products fora 4×4×4 matrix multiply. In practice, Tensor Cores are used to performmuch larger two-dimensional or higher dimensional matrix operations,built up from these smaller elements. An API, such as CUDA 9 C++ API,exposes specialized matrix load, matrix multiply and accumulate, andmatrix store operations to efficiently use Tensor Cores from a CUDA-C++program. At the CUDA level, the warp-level interface assumes 16×16 sizematrices spanning all 32 threads of the warp.

Each SM 440 also comprises M SFUs 552 that perform special functions(e.g., attribute evaluation, reciprocal square root, and the like). Inan embodiment, the SFUs 552 may include a tree traversal unit configuredto traverse a hierarchical tree data structure. In an embodiment, theSFUs 552 may include texture unit configured to perform texture mapfiltering operations. In an embodiment, the texture units are configuredto load texture maps (e.g., a 2D array of texels) from the memory 304and sample the texture maps to produce sampled texture values for use inshader programs executed by the SM 440. In an embodiment, the texturemaps are stored in the shared memory/L1 cache 470. The texture unitsimplement texture operations such as filtering operations using mip-maps(i.e., texture maps of varying levels of detail). In an embodiment, eachSM 340 includes two texture units.

Each SM 440 also comprises NLSUs 554 that implement load and storeoperations between the shared memory/L1 cache 570 and the register file520. Each SM 440 includes an interconnect network 580 that connects eachof the functional units to the register file 520 and the LSU 554 to theregister file 520, shared memory/L1 cache 570. In an embodiment, theinterconnect network 580 is a crossbar that can be configured to connectany of the functional units to any of the registers in the register file520 and connect the LSUs 554 to the register file and memory locationsin shared memory/L1 cache 570.

The shared memory/L1 cache 570 is an array of on-chip memory that allowsfor data storage and communication between the SM 440 and the primitiveengine 435 and between threads in the SM 440. In an embodiment, theshared memory/L1 cache 570 comprises 128 KB of storage capacity and isin the path from the SM 440 to the partition unit 380. The sharedmemory/L1 cache 570 can be used to cache reads and writes. One or moreof the shared memory/L1 cache 570, L2 cache 460, and memory 304 arebacking stores.

Combining data cache and shared memory functionality into a singlememory block provides the best overall performance for both types ofmemory accesses. The capacity is usable as a cache by programs that donot use shared memory. For example, if shared memory is configured touse half of the capacity, texture and load/store operations can use theremaining capacity. Integration within the shared memory/L1 cache 570enables the shared memory/L1 cache 570 to function as a high-throughputconduit for streaming data while simultaneously providing high-bandwidthand low-latency access to frequently reused data.

When configured for general purpose parallel computation, a simplerconfiguration can be used compared with graphics processing.Specifically, the fixed function graphics processing units shown in FIG.3, are bypassed, creating a much simpler programming model. In thegeneral purpose parallel computation configuration, the workdistribution unit 325 assigns and distributes blocks of threads directlyto the DPCs 420. The threads in a block execute the same program, usinga unique thread ID in the calculation to ensure each thread generatesunique results, using the SM 440 to execute the program and performcalculations, shared memory/L1 cache 570 to communicate between threads,and the LSU 554 to read and write global memory through the sharedmemory/L1 cache 570 and the memory partition unit 380. When configuredfor general purpose parallel computation, the SM 440 can also writecommands that the scheduler unit 320 can use to launch new work on theDPCs 420.

The PPU 300 may be included in a desktop computer, a laptop computer, atablet computer, servers, supercomputers, a smart-phone (e.g., awireless, hand-held device), personal digital assistant (PDA), a digitalcamera, a vehicle, a head mounted display, a hand-held electronicdevice, and the like. In an embodiment, the PPU 300 is embodied on asingle semiconductor substrate. In another embodiment, the PPU 300 isincluded in a system-on-a-chip (SoC) along with one or more otherdevices such as additional PPUs 300, the memory 204, a reducedinstruction set computer (RISC) CPU, a memory management unit (MMU), adigital-to-analog converter (DAC), and the like.

In an embodiment, the PPU 300 may be included on a graphics card thatincludes one or more memory devices 304. The graphics card may beconfigured to interface with a PCIe slot on a motherboard of a desktopcomputer. In yet another embodiment, the PPU 300 may be an integratedgraphics processing unit (iGPU) or parallel processor included in thechipset of the motherboard.

Exemplary Computing System

Systems with multiple GPUs and CPUs are used in a variety of industriesas developers expose and leverage more parallelism in applications suchas artificial intelligence computing. High-performance GPU-acceleratedsystems with tens to many thousands of compute nodes are deployed indata centers, research facilities, and supercomputers to solve everlarger problems. As the number of processing devices within thehigh-performance systems increases, the communication and data transfermechanisms need to scale to support the increased bandwidth.

FIG. 5B is a conceptual diagram of a processing system 500 implementedusing the PPU 300 of FIG. 3, in accordance with an embodiment. Theexemplary system 565 may be configured to implement the method 130 shownin FIG. 1D, the method 150 shown in FIG. 1E, the method 225 shown inFIG. 2B, and/or the method 240 shown in FIG. 2F. The processing system500 includes a CPU 530, switch 510, and multiple PPUs 300 each andrespective memories 304. The NVLink 310 provides high-speedcommunication links between each of the PPUs 300. Although a particularnumber of NVLink 310 and interconnect 302 connections are illustrated inFIG. 5B, the number of connections to each PPU 300 and the CPU 530 mayvary. The switch 510 interfaces between the interconnect 302 and the CPU530. The PPUs 300, memories 304, and NVLinks 310 may be situated on asingle semiconductor platform to form a parallel processing module 525.In an embodiment, the switch 510 supports two or more protocols tointerface between various different connections and/or links.

In another embodiment (not shown), the NVLink 310 provides one or morehigh-speed communication links between each of the PPUs 300 and the CPU530 and the switch 510 interfaces between the interconnect 302 and eachof the PPUs 300. The PPUs 300, memories 304, and interconnect 302 may besituated on a single semiconductor platform to form a parallelprocessing module 525. In yet another embodiment (not shown), theinterconnect 302 provides one or more communication links between eachof the PPUs 300 and the CPU 530 and the switch 510 interfaces betweeneach of the PPUs 300 using the NVLink 310 to provide one or morehigh-speed communication links between the PPUs 300. In anotherembodiment (not shown), the NVLink 310 provides one or more high-speedcommunication links between the PPUs 300 and the CPU 530 through theswitch 510. In yet another embodiment (not shown), the interconnect 302provides one or more communication links between each of the PPUs 300directly. One or more of the NVLink 310 high-speed communication linksmay be implemented as a physical NVLink interconnect or either anon-chip or on-die interconnect using the same protocol as the NVLink310.

In the context of the present description, a single semiconductorplatform may refer to a sole unitary semiconductor-based integratedcircuit fabricated on a die or chip. It should be noted that the termsingle semiconductor platform may also refer to multi-chip modules withincreased connectivity which simulate on-chip operation and makesubstantial improvements over utilizing a conventional busimplementation. Of course, the various circuits or devices may also besituated separately or in various combinations of semiconductorplatforms per the desires of the user. Alternately, the parallelprocessing module 525 may be implemented as a circuit board substrateand each of the PPUs 300 and/or memories 304 may be packaged devices. Inan embodiment, the CPU 530, switch 510, and the parallel processingmodule 525 are situated on a single semiconductor platform.

In an embodiment, the signaling rate of each NVLink 310 is 20 to 25Gigabits/second and each PPU 300 includes six NVLink 310 interfaces (asshown in FIG. 5B, five NVLink 310 interfaces are included for each PPU300). Each NVLink 310 provides a data transfer rate of 25Gigabytes/second in each direction, with six links providing 300Gigabytes/second. The NVLinks 310 can be used exclusively for PPU-to-PPUcommunication as shown in FIG. 5B, or some combination of PPU-to-PPU andPPU-to-CPU, when the CPU 530 also includes one or more NVLink 310interfaces.

In an embodiment, the NVLink 310 allows direct load/store/atomic accessfrom the CPU 530 to each PPU's 300 memory 304. In an embodiment, theNVLink 310 supports coherency operations, allowing data read from thememories 304 to be stored in the cache hierarchy of the CPU 530,reducing cache access latency for the CPU 530. In an embodiment, theNVLink 310 includes support for Address Translation Services (ATS),allowing the PPU 300 to directly access page tables within the CPU 530.One or more of the NVLinks 310 may also be configured to operate in alow-power mode.

FIG. 5C illustrates an exemplary system 565 in which the variousarchitecture and/or functionality of the various previous embodimentsmay be implemented. The exemplary system 565 may be configured toimplement the method 130 shown in FIG. 1D, the method 150 shown in FIG.1E, the method 225 shown in FIG. 2B, and/or the method 240 shown in FIG.2F.

As shown, a system 565 is provided including at least one centralprocessing unit 530 that is connected to a communication bus 575. Thecommunication bus 575 may be implemented using any suitable protocol,such as PCI (Peripheral Component Interconnect), PCI-Express, AGP(Accelerated Graphics Port), HyperTransport, or any other bus orpoint-to-point communication protocol(s). The system 565 also includes amain memory 540. Control logic (software) and data are stored in themain memory 540 which may take the form of random access memory (RAM).

The system 565 also includes input devices 560, the parallel processingsystem 525, and display devices 545, i.e. a conventional CRT (cathoderay tube), LCD (liquid crystal display), LED (light emitting diode),plasma display or the like. User input may be received from the inputdevices 560, e.g., keyboard, mouse, touchpad, microphone, and the like.Each of the foregoing modules and/or devices may even be situated on asingle semiconductor platform to form the system 565. Alternately, thevarious modules may also be situated separately or in variouscombinations of semiconductor platforms per the desires of the user.

Further, the system 565 may be coupled to a network (e.g., atelecommunications network, local area network (LAN), wireless network,wide area network (WAN) such as the Internet, peer-to-peer network,cable network, or the like) through a network interface 535 forcommunication purposes.

The system 565 may also include a secondary storage (not shown). Thesecondary storage 610 includes, for example, a hard disk drive and/or aremovable storage drive, representing a floppy disk drive, a magnetictape drive, a compact disk drive, digital versatile disk (DVD) drive,recording device, universal serial bus (USB) flash memory. The removablestorage drive reads from and/or writes to a removable storage unit in awell-known manner.

Computer programs, or computer control logic algorithms, may be storedin the main memory 540 and/or the secondary storage. Such computerprograms, when executed, enable the system 565 to perform variousfunctions. The memory 540, the storage, and/or any other storage arepossible examples of computer-readable media.

The architecture and/or functionality of the various previous figuresmay be implemented in the context of a general computer system, acircuit board system, a game console system dedicated for entertainmentpurposes, an application-specific system, and/or any other desiredsystem. For example, the system 565 may take the form of a desktopcomputer, a laptop computer, a tablet computer, servers, supercomputers,a smart-phone (e.g., a wireless, hand-held device), personal digitalassistant (PDA), a digital camera, a vehicle, a head mounted display, ahand-held electronic device, a mobile phone device, a television,workstation, game consoles, embedded system, and/or any other type oflogic.

While various embodiments have been described above, it should beunderstood that they have been presented by way of example only, and notlimitation. Thus, the breadth and scope of a preferred embodiment shouldnot be limited by any of the above-described exemplary embodiments, butshould be defined only in accordance with the following claims and theirequivalents.

Machine Learning

Deep neural networks (DNNs) developed on processors, such as the PPU 300have been used for diverse use cases, from self-driving cars to fasterdrug development, from automatic image captioning in online imagedatabases to smart real-time language translation in video chatapplications. Deep learning is a technique that models the neurallearning process of the human brain, continually learning, continuallygetting smarter, and delivering more accurate results more quickly overtime. A child is initially taught by an adult to correctly identify andclassify various shapes, eventually being able to identify shapeswithout any coaching. Similarly, a deep learning or neural learningsystem needs to be trained in object recognition and classification forit get smarter and more efficient at identifying basic objects, occludedobjects, etc., while also assigning context to objects.

At the simplest level, neurons in the human brain look at various inputsthat are received, importance levels are assigned to each of theseinputs, and output is passed on to other neurons to act upon. Anartificial neuron or perceptron is the most basic model of a neuralnetwork. In one example, a perceptron may receive one or more inputsthat represent various features of an object that the perceptron isbeing trained to recognize and classify, and each of these features isassigned a certain weight based on the importance of that feature indefining the shape of an object.

A deep neural network (DNN) model includes multiple layers of manyconnected perceptrons (e.g., nodes) that can be trained with enormousamounts of input data to quickly solve complex problems with highaccuracy. In one example, a first layer of the DLL model breaks down aninput image of an automobile into various sections and looks for basicpatterns such as lines and angles. The second layer assembles the linesto look for higher level patterns such as wheels, windshields, andmirrors. The next layer identifies the type of vehicle, and the finalfew layers generate a label for the input image, identifying the modelof a specific automobile brand.

Once the DNN is trained, the DNN can be deployed and used to identifyand classify objects or patterns in a process known as inference.Examples of inference (the process through which a DNN extracts usefulinformation from a given input) include identifying handwritten numberson checks deposited into ATM machines, identifying images of friends inphotos, delivering movie recommendations to over fifty million users,identifying and classifying different types of automobiles, pedestrians,and road hazards in driverless cars, or translating human speech inreal-time.

During training, data flows through the DNN in a forward propagationphase until a prediction is produced that indicates a labelcorresponding to the input. If the neural network does not correctlylabel the input, then errors between the correct label and the predictedlabel are analyzed, and the weights are adjusted for each feature duringa backward propagation phase until the DNN correctly labels the inputand other inputs in a training dataset. Training complex neural networksrequires massive amounts of parallel computing performance, includingfloating-point multiplications and additions that are supported by thePPU 300. Inferencing is less compute-intensive than training, being alatency-sensitive process where a trained neural network is applied tonew inputs it has not seen before to classify images, translate speech,and generally infer new information.

Neural networks rely heavily on matrix math operations, and complexmulti-layered networks require tremendous amounts of floating-pointperformance and bandwidth for both efficiency and speed. With thousandsof processing cores, optimized for matrix math operations, anddelivering tens to hundreds of TFLOPS of performance, the PPU 300 is acomputing platform capable of delivering performance required for deepneural network-based artificial intelligence and machine learningapplications.

What is claimed is:
 1. A computer-implemented method, comprising:receiving ground truth property data for a first frame of a videosequence defining values of a property of each pixel in the first frame;receiving ground truth property data for a second frame of the videosequence defining values of the property of each pixel in the secondframe; receiving task-specific affinity values for transitions from thefirst frame to the second frame; processing, by a first switchabletemporal propagation neural network, the ground truth property data forthe first frame and the task-specific affinity values to produceproperty data for the second frame; processing, by a second switchabletemporal propagation neural network, the ground truth property data forthe second frame and the task-specific affinity values to produceproperty data for the first frame; and updating coefficients of thefirst switchable temporal propagation neural network to reducedifferences between the ground truth property data for the second frameand the property data for the second frame.
 2. The computer-implementedmethod of claim 1, further comprising updating coefficients of thesecond switchable temporal propagation neural network to reducedifferences between the ground truth property data for the first frameand the property data for the first frame.
 3. The computer-implementedmethod of claim 1, wherein a guidance neural network model generates thetask-specific affinity values for a task based on task-specific data forthe first frame defining values of an attribute of pixels in the firstframe and task-specific data for the second frame defining values of theattribute of pixels in the second frame.
 4. The computer-implementedmethod of claim 3, wherein the guidance neural network model is jointlytrained with the first switchable temporal propagation neural networkand the second switchable temporal propagation neural network using atraining dataset for the task.
 5. The computer-implemented method ofclaim 3, further comprising updating parameters of the guidance neuralnetwork model to reduce the differences between the ground truthproperty data for the second frame and the property data for the secondframe.
 6. The computer-implemented method of claim 3, further comprisingupdating parameters of the guidance neural network model to reducedifferences between a style energy of the ground truth property data forthe second frame and a style energy of the property data for the secondframe.
 7. The computer-implemented method of claim 1, wherein thetask-specific affinity values comprise a global transformation matrix.8. The computer-implemented method of claim 7, wherein the secondswitchable temporal propagation neural network is configured to producethe property data for the first frame according to an inversetransformation matrix corresponding to the global transformation matrix.9. The computer-implemented method of claim 8, wherein the inversetransformation matrix and the global transformation matrix areorthogonal when the differences between a style energy of the groundtruth property data for the second frame and a style energy of theproperty data for the second frame are minimized.
 10. A system,comprising: a processor configured to implement a first switchabletemporal propagation neural network and a second switchable temporalpropagation neural network, wherein the first switchable temporalpropagation neural network is configured to: receive ground truthproperty data for a first of a video sequence defining values of aproperty of each pixel in the first frame; receive task-specificaffinity values for transitions from the first frame to the secondframe; and process the property data for the first frame and thetask-specific affinity values to produce property data for the secondframe, and the second switchable temporal propagation neural network isconfigured to: receive ground truth property data for a second frame ofthe video sequence defining values of the property of each pixel in thesecond frame; and process ground truth property data for the secondframe and the task-specific affinity values to produce property data forthe first frame, wherein coefficients of the first switchable temporalpropagation neural network are updated to reduce differences between theground truth property data for the second frame and the property datafor the second frame.
 11. The system of claim 10, wherein coefficientsof the second switchable temporal propagation neural network are updatedto reduce differences between the ground truth property data for thefirst frame and the property data for the first frame.
 12. The system ofclaim 10, wherein the processor is further configured to implement aguidance neural network model that generates the task-specific affinityvalues for a task based on task-specific data for the first framedefining values of an attribute of pixels in the first frame andtask-specific data for the second frame defining values of the attributeof pixels in the second frame.
 13. The system of claim 12, wherein theguidance neural network model is jointly trained with the firstswitchable temporal propagation neural network and the second switchabletemporal propagation neural network using a training dataset for thetask.
 14. The system of claim 12, wherein parameters of the guidanceneural network model are updated to reduce the differences between theground truth property data for the second frame and the property datafor the second frame.
 15. The system of claim 12, wherein parameters ofthe guidance neural network model are updated to reduce differencesbetween a style energy of the ground truth property data for the secondframe and a style energy of the property data for the second frame. 16.The system of claim 10, wherein the task-specific affinity valuescomprise a global transformation matrix.
 17. The system of claim 16,wherein the second switchable temporal propagation neural network isconfigured to produce the property data for the first frame according toan inverse transformation matrix corresponding to the globaltransformation matrix.
 18. The system of claim 17, wherein the inversetransformation matrix and the global transformation matrix areorthogonal when the differences between a style energy of the groundtruth property data for the second frame and a style energy of theproperty data for the second frame are minimized.
 19. A non-transitorycomputer-readable media storing computer instructions that, whenexecuted by one or more processors, cause the one or more processors toperform the steps of: receiving ground truth property data for a firstframe of a video sequence defining values of a property of each pixel inthe first frame; receiving ground truth property data for a second frameof the video sequence defining values of the property of each pixel inthe second frame; receiving task-specific affinity values fortransitions from the first frame to the second frame; processing, by afirst switchable temporal propagation neural network, the ground truthproperty data for the first frame and the task-specific affinity valuesto produce property data for the second frame; processing, by a secondswitchable temporal propagation neural network, the ground truthproperty data for the second frame and the task-specific affinity valuesto produce property data for the first frame; and updating coefficientsof the first switchable temporal propagation neural network to reducedifferences between the ground truth property data for the second frameand the property data for the second frame.
 20. The non-transitorycomputer-readable media of claim 19, further comprising updatingcoefficients of the second switchable temporal propagation neuralnetwork to reduce differences between the ground truth property data forthe first frame and the property data for the first frame.